import React from 'react';
import './style.css'
import {Row, Col} from 'antd';
import NoteCard from "../../components/Notecard/index";

class Index extends React.Component{

    state = {
        list: [{id: 1, title: '222', content: 'asdafdrrawdaw', date: '2017-12-06'},
            {id: 2, title: '222', content: 'asdafdrrawdaw', date: '2017-12-06'},
            {id: 3, title: '222', content: 'asdafdrrawdaw', date: '2017-12-06'}]
    };

    // componentDidMount(){
    //     request.fetchList()
    //         .then(res =>{
    //             this.setState({list: res.list})
    //             }
    //         )
    // }

    render() {
      const renderCardList = this.state.list.map(item => (<NoteCard key={item.id} date={item.date} title={item.title} content={item.content}/>));

        return (
            <div>
                <Row>
                    <Col span={3}/>
                    <Col span={18}>
                        {renderCardList}
                    </Col>
                    <Col span={3}/>
                </Row>
            </div>

        )
    }

}

export default Index